<template>
  <div>
<router-view v-slot="{ Component }">
  <keep-alive>
    <component :is="Component" v-if="$route.meta.keepAlive"/>
  </keep-alive>
</router-view>
 <router-view v-if="!$route.meta.keepAlive" />
    <Footer v-if="show" />
  </div>
</template>

<script setup>
import Footer from './components/footer.vue'
import { ref } from 'vue'
import { useRouter } from 'vue-router'


let show = ref(false)
const menu = ref(['/home', '/dynamic', '/mine'])
const router = useRouter()

router.afterEach(() => {//menu里面的路径需要底部导航
  show.value = menu.value.includes(router.currentRoute.value.path)
})

</script>

<style>
</style>
